import { requestClient,requestClientBody } from '#/api/request';

/**
 * 获取分类列表
 */
export async function getAllApi(status?: string, name?: string) {
  return requestClient.get('/help_category/lists?status='+(status??'1')+'&name='+(name??''));
}
/**
 * 获取用于表单的所有分类
 */
export async function getTreesApi() {
  return requestClient.get('/help_category/trees');
}
  
/**
 * 新增分类
 */
export async function createApi(data: any) {
  return requestClientBody.post('/help_category/add', {form:data});
}

/**
 * 编辑分类
 */
export async function editApi(data: any) {
  return requestClientBody.post('/help_category/edit?id='+data.id, {form:data});
}

/**
 * 更新状态
 */
export async function setstatusApi(data: any) {
  return requestClientBody.post('/help_category/setstatus', data);
}

/**
 * 删除分类
 */
export async function deleteApi(id: number) {
  return requestClientBody.post('/help_category/delete?id='+id);
}